package com.sip.stream.gbstack;


public class GS28181Result<T> {
    public int code;
    public T data;
    public String message;

    public GS28181Result() {
        this.code = 0;
        this.message = "";
        this.data = null;
    }

    public GS28181Result(T data) {
        this.code = 0;
        this.message = "";
        this.data = data;
    }

    public GS28181Result(int code) {
        this.message = "";
        this.data = null;
        this.code = code;
        this.message = RetCode.getErrorMsg(code);
    }

    public GS28181Result(int code, String message) {
        this.data = null;
        this.code = code;
        this.message = message;
    }

    public boolean isSuccess() {
        int i = this.code;
        return i == 0 || i == 10000;
    }
}
